import 'dart:convert';
// 用户信息

class UserModel {
  final String? token;
  final int? memberId;
  final String? mobile;
  final String? nickName;
  final String? picUrl;
  final int? isVip;
  final String? imUser;
  final String? imPass;
  final int? memberType;
  final int? sex;
  final int? age;
  final int? industryFid;
  final int? industrySid;
  final String? industryName;
  final String? emotionalState;
  final String? autograph;
  final String? inviteCode;
  final String? uuid;
  final int? issetPassword;
  final int? shopUserRole;
  final int? mId;
  final int? shopStatus;

  UserModel({
    this.token,
    this.memberId,
    this.mobile,
    this.nickName,
    this.picUrl,
    this.isVip,
    this.imUser,
    this.imPass,
    this.memberType,
    this.sex,
    this.age,
    this.industryFid,
    this.industrySid,
    this.industryName,
    this.emotionalState,
    this.autograph,
    this.inviteCode,
    this.uuid,
    this.issetPassword,
    this.shopUserRole,
    this.mId,
    this.shopStatus,
  });

  factory UserModel.fromJson(String str) => UserModel.fromMap(json.decode(str));

  String toJson() => json.encode(toMap());

  factory UserModel.fromMap(Map<String, dynamic> json) => UserModel(
        token: json["token"],
        memberId: json["member_id"],
        mobile: json["mobile"],
        nickName: json["nickName"],
        picUrl: json["picUrl"],
        isVip: json["is_vip"],
        imUser: json["im_user"],
        imPass: json["im_pass"],
        memberType: json["member_type"],
        sex: json["sex"],
        age: json["age"],
        industryFid: json["industry_fid"],
        industrySid: json["industry_sid"],
        industryName: json["industry_name"],
        emotionalState: json["emotional_state"],
        autograph: json["autograph"],
        inviteCode: json["invite_code"],
        uuid: json["uuid"],
        issetPassword: json["isset_password"],
        shopUserRole: json["shop_user_role"],
        mId: json["m_id"],
        shopStatus: json["shop_status"],
      );

  Map<String, dynamic> toMap() => {
        "token": token,
        "member_id": memberId,
        "mobile": mobile,
        "nickName": nickName,
        "picUrl": picUrl,
        "is_vip": isVip,
        "im_user": imUser,
        "im_pass": imPass,
        "member_type": memberType,
        "sex": sex,
        "age": age,
        "industry_fid": industryFid,
        "industry_sid": industrySid,
        "industry_name": industryName,
        "emotional_state": emotionalState,
        "autograph": autograph,
        "invite_code": inviteCode,
        "uuid": uuid,
        "isset_password": issetPassword,
        "shop_user_role": shopUserRole,
        "m_id": mId,
        "shop_status": shopStatus,
      };
}



class UserDetailModel {
    final int? code;
    final String? msg;
    final ShopData? shopData;
    final List<dynamic>? tagList;
    final UserData? userData;

    UserDetailModel({
        this.code,
        this.msg,
        this.shopData,
        this.tagList,
        this.userData,
    });

    factory UserDetailModel.fromJson(String str) => UserDetailModel.fromMap(json.decode(str));

    String toJson() => json.encode(toMap());

    factory UserDetailModel.fromMap(Map<String, dynamic> json) => UserDetailModel(
        code: json["code"],
        msg: json["msg"],
        shopData: json["shop_data"] == null ? null : ShopData.fromMap(json["shop_data"]),
        tagList: json["tag_list"] == null ? [] : List<dynamic>.from(json["tag_list"]!.map((x) => x)),
        userData: json["data"] == null ? null : UserData.fromMap(json["data"]),
    );

    Map<String, dynamic> toMap() => {
        "code": code,
        "msg": msg,
        "shop_data": shopData?.toMap(),
        "tag_list": tagList == null ? [] : List<dynamic>.from(tagList!.map((x) => x)),
        "data": userData?.toMap(),
    };
}

class ShopData {
    final int? isOpenShopMall;
    final int? isOpenMyShop;
    final int? isShowMyShop;
    final int? mId;
    final int? shopStatus;
    final String? shopStatusMsg;
    final String? shopStatusReason;
    final String? shopStatusDesc;
    final int? shopUserRole;
    final String? shopUserNotice;
    final int? shopUserRoleStatus;
    final String? shopKefuBindTime;
    final int? shopInfoCheck;
    final int? jumpType;
    final int? merchantsType;
    final String? safetyPromiseStr;
    final String? merchantsSafetyPromiseStr;
    final String? safetyPromiseTitle;
    final int? violationNums;
    final String? violationNoticeMsg;
    final int? violationPaymentStatus;
    final String? shopDepositStr;
    final String? shopTechnicianNotice;
    final String? shopMerchantsLogo;
    final String? shopTechnicianBoldNotice;
    final int? shopTechnicianRoleStatus;
    final int? managerId;
    final String? shopManagerName;
    final String? shopManagerQrCode;
    final String? shopManagerText;
    final int? isOpenPlayWith;
    final int? isOpenPlaySpread;
    final int? isOpenTeam;

    ShopData({
        this.isOpenShopMall,
        this.isOpenMyShop,
        this.isShowMyShop,
        this.mId,
        this.shopStatus,
        this.shopStatusMsg,
        this.shopStatusReason,
        this.shopStatusDesc,
        this.shopUserRole,
        this.shopUserNotice,
        this.shopUserRoleStatus,
        this.shopKefuBindTime,
        this.shopInfoCheck,
        this.jumpType,
        this.merchantsType,
        this.safetyPromiseStr,
        this.merchantsSafetyPromiseStr,
        this.safetyPromiseTitle,
        this.violationNums,
        this.violationNoticeMsg,
        this.violationPaymentStatus,
        this.shopDepositStr,
        this.shopTechnicianNotice,
        this.shopMerchantsLogo,
        this.shopTechnicianBoldNotice,
        this.shopTechnicianRoleStatus,
        this.managerId,
        this.shopManagerName,
        this.shopManagerQrCode,
        this.shopManagerText,
        this.isOpenPlayWith,
        this.isOpenPlaySpread,
        this.isOpenTeam,
    });

    factory ShopData.fromJson(String str) => ShopData.fromMap(json.decode(str));

    String toJson() => json.encode(toMap());

    factory ShopData.fromMap(Map<String, dynamic> json) => ShopData(
        isOpenShopMall: json["is_open_shop_mall"],
        isOpenMyShop: json["is_open_my_shop"],
        isShowMyShop: json["is_show_my_shop"],
        mId: json["m_id"],
        shopStatus: json["shop_status"],
        shopStatusMsg: json["shop_status_msg"],
        shopStatusReason: json["shop_status_reason"],
        shopStatusDesc: json["shop_status_desc"],
        shopUserRole: json["shop_user_role"],
        shopUserNotice: json["shop_user_notice"],
        shopUserRoleStatus: json["shop_user_role_status"],
        shopKefuBindTime: json["shop_kefu_bind_time"],
        shopInfoCheck: json["shop_info_check"],
        jumpType: json["jump_type"],
        merchantsType: json["merchants_type"],
        safetyPromiseStr: json["safety_promise_str"],
        merchantsSafetyPromiseStr: json["merchants_safety_promise_str"],
        safetyPromiseTitle: json["safety_promise_title"],
        violationNums: json["violation_nums"],
        violationNoticeMsg: json["violation_notice_msg"],
        violationPaymentStatus: json["violation_payment_status"],
        shopDepositStr: json["shop_deposit_str"],
        shopTechnicianNotice: json["shop_technician_notice"],
        shopMerchantsLogo: json["shop_merchants_logo"],
        shopTechnicianBoldNotice: json["shop_technician_bold_notice"],
        shopTechnicianRoleStatus: json["shop_technician_role_status"],
        managerId: json["manager_id"],
        shopManagerName: json["shop_manager_name"],
        shopManagerQrCode: json["shop_manager_qr_code"],
        shopManagerText: json["shop_manager_text"],
        isOpenPlayWith: json["is_open_play_with"],
        isOpenPlaySpread: json["is_open_play_spread"],
        isOpenTeam: json["is_open_team"],
    );

    Map<String, dynamic> toMap() => {
        "is_open_shop_mall": isOpenShopMall,
        "is_open_my_shop": isOpenMyShop,
        "is_show_my_shop": isShowMyShop,
        "m_id": mId,
        "shop_status": shopStatus,
        "shop_status_msg": shopStatusMsg,
        "shop_status_reason": shopStatusReason,
        "shop_status_desc": shopStatusDesc,
        "shop_user_role": shopUserRole,
        "shop_user_notice": shopUserNotice,
        "shop_user_role_status": shopUserRoleStatus,
        "shop_kefu_bind_time": shopKefuBindTime,
        "shop_info_check": shopInfoCheck,
        "jump_type": jumpType,
        "merchants_type": merchantsType,
        "safety_promise_str": safetyPromiseStr,
        "merchants_safety_promise_str": merchantsSafetyPromiseStr,
        "safety_promise_title": safetyPromiseTitle,
        "violation_nums": violationNums,
        "violation_notice_msg": violationNoticeMsg,
        "violation_payment_status": violationPaymentStatus,
        "shop_deposit_str": shopDepositStr,
        "shop_technician_notice": shopTechnicianNotice,
        "shop_merchants_logo": shopMerchantsLogo,
        "shop_technician_bold_notice": shopTechnicianBoldNotice,
        "shop_technician_role_status": shopTechnicianRoleStatus,
        "manager_id": managerId,
        "shop_manager_name": shopManagerName,
        "shop_manager_qr_code": shopManagerQrCode,
        "shop_manager_text": shopManagerText,
        "is_open_play_with": isOpenPlayWith,
        "is_open_play_spread": isOpenPlaySpread,
        "is_open_team": isOpenTeam,
    };
}

class UserData {
    final int? id;
    final String? uuid;
    final String? nickname;
    final String? mobile;
    final int? sex;
    final int? age;
    final int? memberType;
    final int? isCheck;
    final int? isVip;
    final int? vipId;
    final String? vipEndTime;
    final String? memberImg;
    final String? addsProvince;
    final String? addsCity;
    final String? addsArea;
    final num? lon;
    final num? lat;
    final String? wechatNumber;
    final int? industryFid;
    final int? industrySid;
    final String? industryName;
    final int? imgCheckStatus;
    final String? imgCheckMsg;
    final int? isCanModifyImages;
    final String? imageModifyMsg;
    final int? imageCheckStatus;
    final String? education;
    final String? annualIncome;
    final String? emotionalState;
    final String? height;
    final String? weight;
    final String? hometown;
    final String? constellation;
    final String? autograph;
    final String? imUser;
    final String? inviteCode;
    final int? vipType;
    final int? tId;
    final String? tNickname;
    final String? tMemberImg;
    final String? slotId;
    final ActivityData? activityData;

    UserData({
        this.id,
        this.uuid,
        this.nickname,
        this.mobile,
        this.sex,
        this.age,
        this.memberType,
        this.isCheck,
        this.isVip,
        this.vipId,
        this.vipEndTime,
        this.memberImg,
        this.addsProvince,
        this.addsCity,
        this.addsArea,
        this.lon,
        this.lat,
        this.wechatNumber,
        this.industryFid,
        this.industrySid,
        this.industryName,
        this.imgCheckStatus,
        this.imgCheckMsg,
        this.isCanModifyImages,
        this.imageModifyMsg,
        this.imageCheckStatus,
        this.education,
        this.annualIncome,
        this.emotionalState,
        this.height,
        this.weight,
        this.hometown,
        this.constellation,
        this.autograph,
        this.imUser,
        this.inviteCode,
        this.vipType,
        this.tId,
        this.tNickname,
        this.tMemberImg,
        this.slotId,
        this.activityData,
    });

    factory UserData.fromJson(String str) => UserData.fromMap(json.decode(str));

    String toJson() => json.encode(toMap());

    factory UserData.fromMap(Map<String, dynamic> json) => UserData(
        id: json["id"],
        uuid: json["uuid"],
        nickname: json["nickname"],
        mobile: json["mobile"],
        sex: json["sex"],
        age: json["age"],
        memberType: json["member_type"],
        isCheck: json["is_check"],
        isVip: json["is_vip"],
        vipId: json["vip_id"],
        vipEndTime: json["vip_end_time"],
        memberImg: json["member_img"],
        addsProvince: json["adds_province"],
        addsCity: json["adds_city"],
        addsArea: json["adds_area"],
        lon: json["lon"],
        lat: json["lat"],
        wechatNumber: json["wechat_number"],
        industryFid: json["industry_fid"],
        industrySid: json["industry_sid"],
        industryName: json["industry_name"],
        imgCheckStatus: json["img_check_status"],
        imgCheckMsg: json["img_check_msg"],
        isCanModifyImages: json["is_can_modify_images"],
        imageModifyMsg: json["image_modify_msg"],
        imageCheckStatus: json["image_check_status"],
        education: json["education"],
        annualIncome: json["annual_income"],
        emotionalState: json["emotional_state"],
        height: json["height"],
        weight: json["weight"],
        hometown: json["hometown"],
        constellation: json["constellation"],
        autograph: json["autograph"],
        imUser: json["im_user"],
        inviteCode: json["invite_code"],
        vipType: json["vipType"],
        tId: json["t_id"],
        tNickname: json["t_nickname"],
        tMemberImg: json["t_member_img"],
        slotId: json["slot_id"],
        activityData: json["activity_data"] == null ? null : ActivityData.fromMap(json["activity_data"]),
    );

    Map<String, dynamic> toMap() => {
        "id": id,
        "uuid": uuid,
        "nickname": nickname,
        "mobile": mobile,
        "sex": sex,
        "age": age,
        "member_type": memberType,
        "is_check": isCheck,
        "is_vip": isVip,
        "vip_id": vipId,
        "vip_end_time": vipEndTime,
        "member_img": memberImg,
        "adds_province": addsProvince,
        "adds_city": addsCity,
        "adds_area": addsArea,
        "lon": lon,
        "lat": lat,
        "wechat_number": wechatNumber,
        "industry_fid": industryFid,
        "industry_sid": industrySid,
        "industry_name": industryName,
        "img_check_status": imgCheckStatus,
        "img_check_msg": imgCheckMsg,
        "is_can_modify_images": isCanModifyImages,
        "image_modify_msg": imageModifyMsg,
        "image_check_status": imageCheckStatus,
        "education": education,
        "annual_income": annualIncome,
        "emotional_state": emotionalState,
        "height": height,
        "weight": weight,
        "hometown": hometown,
        "constellation": constellation,
        "autograph": autograph,
        "im_user": imUser,
        "invite_code": inviteCode,
        "vipType": vipType,
        "t_id": tId,
        "t_nickname": tNickname,
        "t_member_img": tMemberImg,
        "slot_id": slotId,
        "activity_data": activityData?.toMap(),
    };
}

class ActivityData {
    final Activity? activityUser;
    final Activity? activityTech;

    ActivityData({
        this.activityUser,
        this.activityTech,
    });

    factory ActivityData.fromJson(String str) => ActivityData.fromMap(json.decode(str));

    String toJson() => json.encode(toMap());

    factory ActivityData.fromMap(Map<String, dynamic> json) => ActivityData(
        activityUser: json["activity_user"] == null ? null : Activity.fromMap(json["activity_user"]),
        activityTech: json["activity_tech"] == null ? null : Activity.fromMap(json["activity_tech"]),
    );

    Map<String, dynamic> toMap() => {
        "activity_user": activityUser?.toMap(),
        "activity_tech": activityTech?.toMap(),
    };
}

class Activity {
    final String? url;
    final String? size;

    Activity({
        this.url,
        this.size,
    });

    factory Activity.fromJson(String str) => Activity.fromMap(json.decode(str));

    String toJson() => json.encode(toMap());

    factory Activity.fromMap(Map<String, dynamic> json) => Activity(
        url: json["url"],
        size: json["size"],
    );

    Map<String, dynamic> toMap() => {
        "url": url,
        "size": size,
    };
}
